/*
 * @Author: Marte
 * @Date:   2016-10-24 11:41:54
 * @Last Modified by:   Marte
 * @Last Modified time: 2016-10-25 17:53:53
 */

'use strict';

var sequelizeService = require('../utils/sequelizeService');

sequelizeService.sequelize
    .sync()
    .then(function() {
        var model = sequelizeService.models.Pic;

        var arr = [{
            fileName: '132256850',
            origName: '3251458.jpg'
        }, {
            fileName: '265877428',
            origName: '3254878.jpg'
        }, {
            fileName: '350605478',
            origName: '125488668.jpg'
        }, {
            fileName: '6850964504',
            origName: 'BZ1511101023229328.jpg'
        }, {
            fileName: '7540023564',
            origName: 'BZ1511101024030731.jpg'
        }];

        model
            .bulkCreate(arr, { individualHooks: true })
            .then(function() {
                console.log('新增 %d 条记录', arr.length);
            })
            .error(function(err) {
                console.log(err);
            });
    });
